
#include "SHMouseTracker.h"
//#include "SHDebugZones.h"


CSHMouseTracker::CSHMouseTracker(void)
{
}

CSHMouseTracker::~CSHMouseTracker(void)
{
}

void CSHMouseTracker::InitPosition(int x, int y)
{
	POINT pt = {x,y};
	m_ptMouseMove = pt;
	m_ptMouseMovePrev1 = pt;
	m_ptMouseMovePrev2 = pt;

	//SHDEBUGMSG(ZONE_INFO, (_T("*****CSHMouseTracker***** Init: m_ptMouseMove.x:%d, m_ptMouseMovePrev1.x: %d, m_ptMouseMovePrev2.x: %d\r\n"), m_ptMouseMove.x, m_ptMouseMovePrev1.x, m_ptMouseMovePrev2.x));

}

void CSHMouseTracker::UpdatePosition(int x, int y)
{
	POINT pt = {x,y};
	m_ptMouseMovePrev2 = m_ptMouseMovePrev1;
	m_ptMouseMovePrev1 = m_ptMouseMove;
	m_ptMouseMove = pt;

	//SHDEBUGMSG(ZONE_INFO, (_T("*****CSHMouseTracker***** UpdatePosition: m_ptMouseMove.x:%d, m_ptMouseMovePrev1.x: %d, m_ptMouseMovePrev2.x: %d\r\n"), m_ptMouseMove.x, m_ptMouseMovePrev1.x, m_ptMouseMovePrev2.x));

}

void CSHMouseTracker::Reset()
{
	POINT pt = {0,0};
	m_ptMouseMove = pt;
	m_ptMouseMovePrev1 = pt;
	m_ptMouseMovePrev2 = pt;
}

long CSHMouseTracker::GetSpeedX()
{
//	return m_ptMouseMovePrev1.x-m_ptMouseMovePrev2.x;
	return m_ptMouseMove.x-m_ptMouseMovePrev1.x;
}

long CSHMouseTracker::GetSpeedY()
{
	return m_ptMouseMove.y-m_ptMouseMovePrev1.y;
//	return m_ptMouseMovePrev1.y-m_ptMouseMovePrev2.y;
}

long CSHMouseTracker::GetMovedX()
{
	return m_ptMouseMove.x-m_ptMouseMovePrev1.x;
}

long CSHMouseTracker::GetMovedY()
{
	return m_ptMouseMove.y-m_ptMouseMovePrev1.y;
}

POINT CSHMouseTracker::GetPos()
{
	return m_ptMouseMove;
}

POINT CSHMouseTracker::GetPosPrev1()
{
	return m_ptMouseMovePrev1;
}

POINT CSHMouseTracker::GetPosPrev2()
{
	return m_ptMouseMovePrev2;
}

